<include file="public@header"/>
<style>
    .table img {
        width: 50px;
    }

    .layui-tab.back {
        margin-bottom: 10px;
    }

    .back a {
        color: #969696;
    }

    .cinfo {
        display: -webkit-flex; /* Safari */
        display: flex;
    }

    .cinfo_l {
        display: -webkit-flex; /* Safari */
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20px;
        width: 200px;
        height: 130px;
    }

    .cinfo_l img {
        max-width: 100%;
        max-height: 100%;
    }

    .cinfo_r {
        flex: 1;
        display: -webkit-flex; /* Safari */
        display: flex;

        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;

    }

    .cinfo_name {
        flex: 1;
        color: #323232;
        font-size: 18px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 600;
    }

    .detail td {
        border-width: 0;
    }

    .trade_item_list{
        display: -webkit-flex; /* Safari */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .trade_item_list .trade_item{
        flex: 1;
    }
    .trade_item_v{
        font-size: 16px;
        font-weight: bold;
    }
    .js_tips{
        margin-left: 10px;
    }
</style>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">

        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-tab layui-tab-brief back">
                        <if condition="$data.o_top_type_id == 1">
                            <a href="{:url('merchant.cate/index')}">返回</a>
                        <elseif condition="$data.o_top_type_id == 3">
                            <a href="{:url('merchant.serve/index')}">返回</a>
                        <elseif condition="$data.o_top_type_id == 4">
                            <a href="{:url('merchant.look_shop/index')}">返回</a>
                        <elseif condition="in_array($data.o_top_type_id,[5,6,7,8])">
                            <a href="{:url('merchant.supermarket/index')}">返回</a>
                        <else/>
                        </if>
                    </div>
                    <div class="cinfo">
                        <div class="cinfo_l">
                            <img src="{$data['thumb']}">
                        </div>
                        <div class="cinfo_r">
                            <div class="cinfo_name">{$data['name']}</div>
                            <div class="cinfo_btn">
                                <a class="layui-btn layui-btn-sm"
                                   href="javascript:admin.openIframeLayer('{:url('merchant.cate/ReadIndustry',array('id'=>$data['id']))}','资质',{area:['60%', '600px'],end:function(){}})">资质</a>
                            </div>
                        </div>

                        <table class="layui-table table-hover table-bordered table-list detail" lay-even=""
                               lay-size="lg">
                            <tbody>
                            <tr style="border-width: 0;">
                    
                                <td><span style="font-weight: 600;">类型: </span>
                                    <span style="color: #9f9f9f;">{$data['store_type']['name'] ?? '--'}</span>
                                </td>
                                <td>
                                    <span style="font-weight: 600;">总评: </span>
                                    <span style="color: #9f9f9f;">{$data['remark'] ?? '--'}</span>
                                </td>
                            </tr>
                            <tr>
                   
                                <td>
                                    <if condition="$data.o_top_type_id == 1">
                                        <span style="font-weight: 600;">口味|包装|配送满意度:</span> {$taste_star}|{$packaging_star}|{$distribution_star}
                                        <elseif condition="$data.o_top_type_id==3">
                                            <span style="font-weight: 600;">总体|态度|质量:</span>{$overall_star}|{$taste_star}|{$packaging_star}
                                        <else/>
                                    </if>
                                </td>

                                <td><span style="font-weight: 600;">营业时间: </span>{$businessHours}</td>
                            </tr>
                            <tr>
                                <td>
                                    <span style="font-weight: 600;">地址:</span> {$data['address']}
                                </td>
                            </tr>
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>
        </div>

        <div class="layui-page-content">

            <div class="layui-card">
                <div class="layui-tab layui-tab-brief">
                    <ul class="layui-tab-title">
                        <li>
                            <a class="<eq name="$type" value="now">layui-this</eq>" href="{:url("merchant.cate/read",["type"=>"now",'id'=>$data['id']])}">当前订单</a>
                        </li>
                        <li>
                            <a class="<eq name="$type" value="before">layui-this</eq>" href="{:url("merchant.cate/read",["type"=>"before",'id'=>$data['id']])}">过往订单</a>
                        </li>
                        <li><a href='{:url("merchant.cate/evaluateIndex",['id'=>$data['id']])}'>评价列表</a></li>
                        <li><a href='{:url("merchant.cate/product",['id'=>$data['id']])}'>商品列表</a></li>
                        <li><a href='{:url("merchant.cate/storeType",['id'=>$data['id']])}'>店铺分类</a></li>
                    </ul>
                </div>

                <div class="layui-card">
                    <div class="layui-card-body">
                        <form class="layui-form" method="get" action="{:url("merchant.cate/read",['id'=>$data['id']])}">
                        <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">
                            <div class="layui-inline">
                                <label class="layui-form-label">时间</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="start_time"
                                           value="{:input('start_time')}"
                                           autocomplete="off" placeholder="开始日期">
                                </div>
                                <div class="layui-form-mid">-</div>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input js-bootstrap-date" name="end_time"
                                           value="{:input('end_time')}"
                                           autocomplete="off" placeholder="结束日期">
                                </div>
                            </div>
                            <input type="hidden" name="type" value="{$type}">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户ID</label>
                                <div class="layui-input-inline">
                                    <input type="text" class="layui-input" name="keywords" value="{:input('keywords')}"
                                           autocomplete="off" placeholder="用户ID">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="submit" class="layui-btn btn-primary" value="搜索"/>
                                    <a class="layui-btn layui-btn-danger btn-danger" href="{:url("merchant.cate/read",["type"=>"now",'id'=>$data['id']])}">清空</a>
                                </div>
                            </div>
                        </div>
                        </form>
                    </div>
                    <div class="layui-card-body">
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                <div class="layui-card">
                                    <div class="layui-card-header">数据统计</div>
                                    <div class="layui-card-body">
                                        <div class="trade_item_list">
                                            <div class="trade_item">
                                                <div class="trade_item_t">
                                                    订单收入
                                                    <span class="layui-icon layui-icon-tips js_tips" data-tip="统计已完成订单的支付总金额，"></span>
                                                </div>
                                                <div class="trade_item_v">
                                                    {$orderPrice}
                                                </div>
                                            </div>

                                            <div class="trade_item">
                                                <div class="trade_item_t">
                                                    订单数量(元)
                                                    <span class="layui-icon layui-icon-tips js_tips" data-tip="统计所有订单的数量，"></span>
                                                </div>
                                                <div class="trade_item_v">
                                                    {$orderCount}
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>

                </div>

                <div class="layui-card-body">
                    <form method="post" class="js-ajax-form" method="post">
                        <table class="layui-table table-hover table-bordered table-list" id="menus-table" lay-even=""
                               lay-size="lg">
                            <thead>
                            <tr>
                                <th width="80">ID</th>
                                <th>单号</th>
                                <th>骑手评分</th>
                                <th>
                                    订单评分
                                </th>
                                <th>支付方式</th>
                                <th>状态</th>
                                <th>下单用户</th>
                                <th>总价</th>
                            
                                <if condition="in_array($data.o_top_type_id,[1])">
                                    <th>配送费</th>
                                </if>
                                <th>支付价格</th>
                                <th>商品数量</th>
                                <th>下单时间</th>
                                <th>完成时间</th>
                                <th align="center">{:lang('ACTIONS')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="order_list" item="vo">
                                <tr>
                                    <td>
                                        {$vo['id']}
                                    </td>
                                    <td>{$vo['order_id']}</td>
                                    <td>{$vo['evaluate']['star'] ?? '--'}</td>
                                    <td>
                                        <if condition="$data.o_top_type_id == 1">
                                        总体:{$vo['order_evaluate']['overall_star'] ?? '--'}|
                                        口味:{$vo['order_evaluate']['taste_star'] ?? '--'}|
                                        包装:{$vo['order_evaluate']['packaging_star'] ?? '--'}
                                        <elseif condition="$data.o_top_type_id==3">
                                        总体:{$vo['order_evaluate']['overall_star'] ?? '--'}|
                                        态度:{$vo['order_evaluate']['taste_star'] ?? '--'}|
                                        质量:{$vo['order_evaluate']['packaging_star'] ?? '--'}
                                        <elseif condition="in_array($data.o_top_type_id,[5,6,7,8])">
                                        总体:{$vo['order_evaluate']['overall_star'] ?? '--'}|
                                        质量:{$vo['order_evaluate']['taste_star'] ?? '--'}|
                                        包装:{$vo['order_evaluate']['packaging_star'] ?? '--'}
                                        <else/>
                                            --
                                        </if>
                                    </td>
                                    <td>{$vo['pay_type']}</td>
                                    <td>{$vo['status']}</td>
                                    <td>{$vo['userinfo']['user_nickname'] ?? ''}({$vo['uid']})</td>
                                    
                                    <td>
                                        {$vo['pay_price']}
                                    </td>
                                    <if condition="in_array($data.o_top_type_id,[1])">
                                        <td>{$vo['free_shipping'] == 0 ? $vo['freight_price'] : '--'}</td>
                                    </if>
                                    <td>{$vo['pay_price']}</td>
                                    <td>{$vo['total_num']}</td>
                                    <td>{$vo['add_time']}</td>
                                    <td>{$vo['end_time']}</td>
                                    <td>
                                        <a class="layui-bo layui-bo-checked layui-bo-small" href="javascript:admin.openIframeLayer('{:url('merchant.cate/readProduct',array('id'=>$vo['id']))}','订单商品',{area:['60%', '600px'],end:function(){}})">商品详情</a>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                        <div class="pagination">{$page}</div>
                    </form>
                </div>

            </div>
        </div>

    </div>

</div>
<include file="public@script"/>

<script>
    (function (){
        $('.js_tips').mouseover(function (){
            let _that=$(this);
            let tip=_that.data('tip');
            layer.tips(tip, _that);
        })
    })()
</script>
</body>
</html>